<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="referrer" content="no-referrer" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../js/axios.js"></script>
    <script src="../js/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div>{{ data.meta.title }}</div>
        <div>{{ data.meta.description }}</div>
        <img :src="data.components[0].data.forumList[0].profileImg" alt=""/>
        <div>时间:{{data.meta.cTime}}</div>
        <a :href="data.meta.shareInfo.pic">新浪话题链接</a>
      
    </div>
</body>

<script>
    
    var app = new Vue({
        el: '#app',
        data: {
            data: {
                meta:{
                    shareInfo:{}
                },
                components:[{
                    data:{
                        forumList:[{
                            profileImg:""
                        }]
                    }
                }]
            },
            index: 0,
         
        },
        methods: {

        },
    })


    let url = "http://127.0.0.1:8000/"
    axios.get(url + "api/index").then(res => {
        let href = this.location.href
        let index = href.split('index=')[1]
        index = Number(index)
        this.app.index = index
        
        let link = res.data.data.result[index].link
        axios.post(url + "api/article/",{
            "link":link
        })
        .then(res => {
            console.log(res.data.data.apiRes.data)
            this.app.data = res.data.data.apiRes.data
        })
        .catch(err => {
            console.error(err); 
        })
       
    })

</script>

</html>